unit VendaRecordFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls, ComCtrls, DBCtrls, ActnList, ExtCtrls, DBGrids, MainRecordFr;

type

  { TVendaRecordFrame }

  TVendaRecordFrame = class(TMainRecordFrame)
    ImprimirAction: TAction;
    DataVenda: TDBEdit;
    DBEdit: TDBEdit;
    DBEdit2: TDBEdit;
    DetailDBGrid: TDBGrid;
    DetailGroupBox: TGroupBox;
    IdClienteDbEdit: TDBEdit;
    IdVenda: TDBEdit;
    Label1: TLabel;
    Label10: TLabel;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label7: TLabel;
    MasterGroupBox: TGroupBox;
    NomePessoaDbEdit: TDBEdit;
    Painel: TPanel;
    Panel14: TPanel;
    Panel15: TPanel;
    SiglaPagamento: TDBRadioGroup;
    ToolButton3: TToolButton;
    ToolButton4: TToolButton;
    TotalPainel1: TDBText;
    procedure ControlaBotoes(); override;
    procedure ImprimirActionExecute(Sender: TObject);

  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses
  VendaFrDM;

{ TVendaRecordFrame }

procedure TVendaRecordFrame.ControlaBotoes;
var
  I: integer;
begin
  for I := 0 to RecordActionList.ActionCount - 1 do begin
    TAction(RecordActionList.Actions[i]).Enabled := False;
  end;
  RecordToolBar.Enabled := True;
  LocalizarAction.Enabled := True;
  FecharAction.Enabled := True;
  if IdVenda.Text <> '' then begin
    ImprimirAction.Enabled := True;
  end;
end;

procedure TVendaRecordFrame.ImprimirActionExecute(Sender: TObject);
begin
  VendaFrData.Imprimir();
end;

initialization
  {$I vendarecordfr.lrs}

end.

